﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;

namespace OpenAuth.App
{
    public class CDRGH007App : ApiBaseApp<CDRGH007>
    {
        public CDRGH007App(IApiRepository<CDRGH007> repository) : base(repository)
        {
        }
        /// <summary>
        /// 当日挂号信息查询（查询门诊患者挂号记录）
        /// </summary>
        /// <param name="patid">患者唯一编码</param>
        /// <param name="ksrq">开始日期</param>
        /// <param name="jsrq">结束日期</param>
        /// <param name="hzxm">患者姓名</param>
        /// <param name="czybz">操作员标志</param>
        /// <param name="ghxh">医生代码</param>
        /// <returns></returns>
        public IEnumerable<CDRGH007> QueryCDRGH007ByPatid(string patid, string ksrq, string jsrq, string hzxm, string czybz, string ghxh)
        {
            List<SqlParameter> param = new List<SqlParameter>();
            param.Add(new SqlParameter("@Patid", patid));
            param.Add(new SqlParameter("@Ksrq", ksrq));
            param.Add(new SqlParameter("@Jsrq", jsrq));
            param.Add(new SqlParameter("@Hzxm", hzxm));
            param.Add(new SqlParameter("@Czybz", czybz));
            param.Add(new SqlParameter("@Ghxh", ghxh));
            param.Add(new SqlParameter("@Czyh", "hf001"));
            var result = Query<CDRGH007>("exec usp_web_webtrans_CDRGH007 @patid=@Patid,@ksrq=@Ksrq,@jsrq=@Jsrq,@hzxm=@Hzxm,@czybz=@Czybz,@ghxh=@Ghxh,@czyh=@Czyh", param);
            return result;
        }
    }
}
